<template>
  <div class="app-box">
    <Layout ref="runBox"
            title="拖车信息绑定"
            temp="Temp3"
            :autoCommit="autoCommit"
            :custom="custom"
            @handleSuccessMqttMessage="handleSuccessMqttMessage"
            :ic="ic"
            :url="url"
            :readID="false"
            :readIC="false"></Layout>
  </div>
</template> 
<script>
import Layout from '../core/layout.vue'
import { GSAConstants } from '@/utils/access'
import {
  log,
} from '@/utils/message'
export default {
  components: { Layout },
  watch: {
    "$store.state.user.menus": {
      handler: function (newValue) {

      }
    }
  },
  data () {
    return {
      ic: GSAConstants().TOPIC_MANUAL_OSD.ic,
      url: GSAConstants().TOPIC_MANUAL_OSD.url,
      autoCommit: false,
      readOnlyForm: {},
      custom: {
        tips: '请输入相应的公司信息和司机信息',
        showReturnReceiptId: true,
        manTelRequire: false,
        reasons: [{
          value: '无PCC卡',
          label: '无PCC卡'
        }, {
          value: 'PCC卡已坏',
          label: 'PCC卡已坏'
        }, {
          value: '无效身份证',
          label: '无效身份证'
        }, {
          value: '使用第一代身份证',
          label: '使用第一代身份证'
        }, {
          value: '使用港澳身份证',
          label: '使用港澳身份证'
        }, {
          value: '使用驾驶证',
          label: '使用驾驶证'
        }, {
          value: '使用从业资格证',
          label: '使用从业资格证'
        }, {
          value: '无任何证件',
          label: '无任何证件'
        }, {
          value: '其他',
          label: '其他'
        }]
      }
    }
  },
  created () {

  },
  mounted () {
  },
  methods: {
    // 刷新菜单权限
    refreshMenus () {
      log('OSD 刷新权限', this.$store.getters.menus)

    },
    showMsg (msg, type) {
      this.$refs.runBox.showMsg(msg, type)
    },
    // 读卡成功的回调信息
    handleSuccessMqttMessage (messageObject) {
      if (messageObject.ic === this.ic) {
        this.showMsg('作业处理成功', 'green')
        // this.$refs.runBox.handleSuccess()
      }
    }
  },
}
</script>

<style scoped>
.app-box {
  padding: 0px;
}
</style>
